package com.dhcc.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 *  表定义层。
 *
 * @author weiyongpeng
 * @since 2024-04-28 10:30:50
 */
public class TbAccountDomain extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public static final TbAccountDomain TB_ACCOUNT = new TbAccountDomain();

    
    public final QueryColumn ID = new QueryColumn(this, "id");

    
    public final QueryColumn AGE = new QueryColumn(this, "age");

    
    public final QueryColumn BIRTHDAY = new QueryColumn(this, "birthday");

    
    public final QueryColumn USER_NAME = new QueryColumn(this, "user_name");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, USER_NAME, AGE, BIRTHDAY};

    public TbAccountDomain() {
        super("", "tb_account");
    }

    private TbAccountDomain(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public TbAccountDomain as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new TbAccountDomain("", "tb_account", alias));
    }

}
